import { http } from '@/utils/http'

interface Device {
  id: number
  name: string
  type: string
  status: string
  createTime: string
  updateTime: string
}

export interface DeviceList {
  code: number
  list: Device[]
  total: number
  pageNum: number
  pageSize: number
  text: string
}

// 获取设备列表数据
export function getDeviceList(params: {
  page: number
  p_total: number
  sb_type: number
  sbid_key: string
  online_chked_rs: number
  query_label_chked_rs: string
  query_md_chked_rs: string
}) {
  return http.post<DeviceList>('/ajax/sb_list.php', {
    act: 'get_sb_list',
    ...params,
  })
}

// 获取支付套餐列表数据
export function getPayList(params: { page: number }) {
  console.log(params)
  return http.post<DeviceList>('/ajax/sb_payPkg.php', { act: 'get_pkg_list', ...params }, null, { 'Content-Type': 'application/x-www-form-urlencoded' })
}
